<%@page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<title><s:property value="dlyhBean.yhm"/>所属用户组</title>
		<base target="_self" />
		<script language="javaScript" src="<%=request.getContextPath()%>/javaScript/menu.js"></script>
	</head>
	
	<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
	<script language="javascript">
	function addrole(addObj,delObj)         
	{         
		estlag = 0 ;        
		for(i=0;i<delObj.length;i++)
		{
			if(delObj.options[i].selected)         
			{         
				estlag = 1;				         
				break;         
			} 
		}         
		for(j=0;j<addObj.length;j++)
		{
			if(addObj.options[j].text==delObj.options[i].text)         
			{         
				estlag = 0  ;       
				break;         
			} 
		}         
		if(estlag == 0)         
			return;         
		rolecnt = addObj.length;        
		rolecnt++;         
		addObj.length = rolecnt ;        
		addObj.options[rolecnt-1].text = delObj.options[i].text;        
		addObj.options[rolecnt-1].value = delObj.options[i].value;      
		for(m=i+1;m<delObj.length;m++)         
		{         
			delObj.options[m-1].text = delObj.options[m].text; 
			delObj.options[m-1].value = delObj.options[m].value;      
		}         
		delObj.length = delObj.length - 1;   
	}         
                  
	function adduserrole()         
	{         
		for(i=0;i<frmuserrole.yhzbhs.length;i++)         
		{         
			frmuserrole.yhzbhs.options[i].selected = true;
		}
		frmuserrole.action="createSsYhz.do";    
		frmuserrole.submit()         
	} 
	mpmenu1=new mMenu(' 保 存 ','adduserrole()','script','<%=request.getContextPath() %>/images/img_ht_wz_8.gif','62','24','2','100','2');
	mpmenu2=new mMenu(' 关 闭 ','window.close()','script','<%=request.getContextPath() %>/images/img_ht_wz_8.gif','62','24','2','100','2'); 
</script>
	<%
		response.setHeader("Pragma", "No-cache");
		response.setHeader("Cache-Control", "no-cache");
		response.setDateHeader("Expires", 0);
		String path = request.getContextPath();
	%>
	<body bgcolor="#F3F7FD">
<form method="POST" name="frmuserrole" >
        <table border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
		<td colspan="8" align="center"><strong><br>用户名：<s:property value="dlyhBean.yhm"/> </strong> &nbsp;<br><br>
			<input type="hidden" name="yhbhs" value="<s:property value="yhbhs"/>">      
			<table border="0" cellpadding="0" cellspacing="0" width="500" height="80%" class="table"><tr>       
								<td>     
					<p align="center">所有用户组：<br>    
					  <select name="sysYhzbhs" size="6" multiple="multiple" class="form1" style="width: 201; height: 218">
					  	<s:iterator value="yhzList" status="index">
					  	<option value="<s:property value="yhzbh"/>"><s:property value="yhzm"/></option>
					  	</s:iterator>       
					</select>           
					</p>    
				</td>     
				<td>     
					<p align="center">
					<a href="javascript:void(0)" onfocus="this.blur()" ><img src="<%=path %>/images/turn-right.gif" border="0" onclick="addrole(frmuserrole.yhzbhs,frmuserrole.sysYhzbhs);"></a><br><br>
					<a href="javascript:void(0)" onfocus="this.blur()" ><img src="<%=path %>/images/turn-left.gif" border="0" onclick="addrole(frmuserrole.sysYhzbhs,frmuserrole.yhzbhs);"></a>     
					</p>      
				</td>
				<td><p align="center">用户所属组：<br>
					  <select name="yhzbhs" size="6" multiple="multiple" class="form1" style="width: 201; height: 218">
					  	<s:iterator value="currYhzList" status="index">
					  	<option value="<s:property value="yhzbh"/>"><s:property value="yhzm"/></option>
					  	</s:iterator>
					</select></p>    
				</td>             
			</tr>      
			<tr>      
   	<td align="center" colspan="3">
  		<div id="funbut">
		<SCRIPT>document.write(mwritetodocument());</SCRIPT>
		</div>
   	</td>     
			</tr>      
		</table>      
		</td>
	</tr>
</table>
</form> 

	</body>
</html>